package com.example.bourse.core.utils;

import java.util.List;

public class PageUtils {
    
    public static class Page<T> {
        private List<T> content;
        private int totalPages;
        private long totalElements;
        private int number;
        private int size;

        public Page(List<T> content, int totalPages, long totalElements, int number, int size) {
            this.content = content;
            this.totalPages = totalPages;
            this.totalElements = totalElements;
            this.number = number;
            this.size = size;
        }

        public List<T> getContent() {
            return content;
        }

        public int getTotalPages() {
            return totalPages;
        }

        public long getTotalElements() {
            return totalElements;
        }

        public int getNumber() {
            return number;
        }

        public int getSize() {
            return size;
        }
    }

    public static <T> Page<T> of(List<T> content, int totalPages, long totalElements, int number, int size) {
        return new Page<>(content, totalPages, totalElements, number, size);
    }
}
